//
//  HMUpgradeTableViewCell.m
//  HowToDo
//
//  Created by 宋轩 on 17/1/4.
//  Copyright © 2017年 KY. All rights reserved.
//

#import "HMUpgradeTableViewCell.h"

@interface HMUpgradeTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *item_titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *addTimeLabel;
@property (nonatomic, strong) UIImageView *item_image_url;


@end

@implementation HMUpgradeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self).mas_offset(UIEdgeInsetsZero);
        make.bottom.equalTo(self.contentLabel.mas_bottom).offset(20);
    }];
}

- (void)setUpgradeModel:(HMUPgradeModel *)upgradeModel
{
    _upgradeModel = upgradeModel;
    self.contentLabel.text = upgradeModel.item_introduce;
    self.item_titleLabel.text = upgradeModel.item_title;
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = @"MM月dd日";
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:upgradeModel.add_time.intValue];
    self.addTimeLabel.text = [formatter stringFromDate:date];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    //    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
